////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2008 Michiel Helvensteijn                                    //
//                                                                            //
// This file is part of the Mist compiler.                                    //
//                                                                            //
// The Mist compiler is free software: you can redistribute it and/or modif   //
// it under the terms of the GNU General Public License as published by       //
// the Free Software Foundation, either version 3 of the License, or          //
// (at your option) any later version.                                        //
//                                                                            //
// The Mist compiler is distributed in the hope that it will be useful,       //
// but WITHOUT ANY WARRANTY; without even the implied warranty of             //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              //
// GNU General Public License for more details.                               //
//                                                                            //
// You should have received a copy of the GNU General Public License          //
// along with the Mist compiler.  If not, see <http://www.gnu.org/licenses/>. //
////////////////////////////////////////////////////////////////////////////////

#define BOOST_TEST_MAIN

/******************************************************************************
 * Includes                                                                   *
 ******************************************************************************/

#include <vector>
using std::vector;

#include <ostream>
using std::ostream;

#include <boost/test/unit_test.hpp>

#include <boost/test/execution_monitor.hpp>

#include <boost/assign.hpp>
using namespace boost::assign;

#include "common.hpp"

/******************************************************************************
 * Convenience Functions                                                      *
 ******************************************************************************/

template<class F>
struct not_t {
	template<class T>
	bool operator()(const T& t) {
		return(!f(t));
	}
	
	template<class T1, class T2>
	bool operator()(const T1& t1, const T2& t2) {
		return(!f(t1, t2));
	}
	
	template<class T1, class T2, class T3>
	bool operator()(const T1& t1, const T2& t2, const T3& t3) {
		return !f(t1, t2, t3);
	}
	
	F f;
};

template<class F>
not_t<F> neg(F f) {
	not_t<F> result = { f };
	return result;
}

namespace std {
	template <class T>
	ostream& operator<<(ostream& out, const vector<T>& vec) {
		out << '[' << implode(vec, ",") << ']';
		
		return out;
	}
}

/******************************************************************************
 * Test Files                                                                 *
 ******************************************************************************/

#include "test/common.test.hpp"
#include "test/cppvisitor.test.hpp"
#include "test/compiler.test.hpp"
